<?php

namespace App\models;

use Illuminate\Database\Eloquent\Model;

class Goods extends Model
{
    protected $table = "goods";
    public $timestamps = false;//这个不要忘记了
//    public function __construct($table)
//    {
//        parent::__construct();
//        $this->table = $table;
//    }
    public function upGoods($id,array $data){
        return $this->where('id',$id)->update($data);
    }
    //单条查询的方法
    public function getfind($id)
    {
        if($this->where('id',$id)->first()){
            return $this->where('id',$id)->first()->toArray();
        }else{
            return [];
        }

    }

}
